import { Express, Request, Response } from "express";
import { readtypeData, readtagData } from "../model/readType";
import { Users } from "../tool/varType";
import { tokenKey } from "../config/config";
export default function (app: Express) {
  app.get("/api/readtypedata", async function (req: Request, res: Response) {
    const { success, data } = await readtypeData();
    if (!success) {
      res.json({ success: false, msg: data.message });
      return;
    }
    res.json({ success: true, data });
  });
  app.get("/api/readtypetag", async function (req: Request, res: Response) {
    const { success, data } = await readtagData();
    if (!success) {
      res.json({ success: false, msg: data.message });
      return;
    }
    res.json({ success: true, data });
  });
}
